﻿Public Class TextTab
    Inherits TabPage

    Public Shadows Property CodeText() As String

    Protected Friend m_textBox As TextBox

    Public Sub New(ByVal path As String)
        MyBase.New()

        Me.Name = path
        Me.Text = IO.Path.GetFileName(path)
        Me.CodeText = My.Computer.FileSystem.ReadAllText(path)
        Me.m_textBox = New TextBox()
        Me.m_textBox.Anchor = _
            CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
            Or System.Windows.Forms.AnchorStyles.Left) _
            Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
        Me.m_textBox.Text = Me.CodeText
        Me.m_textBox.Multiline = True
        Me.m_textBox.WordWrap = False
        Me.m_textBox.Width = Me.Width
        Me.m_textBox.Height = Me.Height
        Me.m_textBox.ScrollBars = ScrollBars.Both
        Me.m_textBox.Location = New Point(0, 0)

        Me.Controls.Add(Me.m_textBox)
    End Sub

End Class